package com.wing.order.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.wing.common.utils.JsonResult;
import com.wing.order.model.entity.OrderDelivery;
import com.wing.order.model.entity.OrderDeliveryLabel;
import com.wing.order.model.request.OrderDeliveryForm;
import com.wing.order.model.response.OrderDeliveryDetailVO;
import com.wing.order.model.response.OrderDeliveryVO;
import com.wing.order.model.response.ScanDeliveryVo;
import com.wing.platform.order.model.response.OrderDistributionLabelVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 配送-Service
 *
 * @author
 */
public interface OrderDeliveryService extends IService<OrderDelivery> {

    /**
     * 添加
     *
     * @param orderDeliveryForm
     * @return
     */
    int add(OrderDeliveryForm orderDeliveryForm);

    /**
     * 列表-app
     *
     * @param params
     * @return
     */
    List<OrderDeliveryVO> list4app(Map<String, Object> params);

    /**
     * 分页list-app
     *
     * @param page
     * @param params
     * @return
     */
    Page<OrderDeliveryVO> pageList4app(Page page, Map<String, Object> params);

    /**
     * 详情-app
     *
     * @param id
     * @return
     */
    OrderDeliveryVO get4appById(Long id);


    /**
     * 查看待上货列表
     */
    Page<OrderDeliveryVO> stock(Page<OrderDeliveryVO> page,Map<String, Object> params);


    /**
     * 查看该批号 详情
     */
    List<OrderDeliveryDetailVO> stockInfo(@Param("deliveryOrderCode") String deliveryOrderCode);

    /**
     * 查看已完成
     */
    Page<OrderDeliveryVO> finshInfo(Page<OrderDeliveryVO> page,Map<String, Object> params);


    /**
     * 签收明细 产品信息
     */
    List<OrderDeliveryVO> signProduct(String skuCode,String deliveryOrderCode);


    /**
     *以签收信息列表
     */
    Page<OrderDeliveryVO> infoSignList(Page<OrderDeliveryVO> page, Map<String, Object> params);

    /**
     * 以签收信息详情
     * @param deliveryOrderCode
     * @return
     */
    List<OrderDeliveryVO> infoSign(String deliveryOrderCode);





    JsonResult<OrderDeliveryVO> syncStorage( List<com.wing.platform.order.model.response.OrderDeliveryVO> list);
    //将平台端同步到企业端
    JsonResult<ScanDeliveryVo> syncStorage(List<ScanDeliveryVo> deliveryDetailVO,String remark);

    /**
     *领货列表
     */
    Page<OrderDeliveryVO> pickupList(Page<OrderDeliveryVO> page, Map<String, Object> params);

    /**
     * 領貨详情
     * @param deliveryOrderCode
     * @return
     */
    List<OrderDeliveryDetailVO> pickupDetail(String deliveryOrderCode);

    List<OrderDeliveryVO> admSign(String deliveryOrderCode);

    OrderDeliveryVO scanLable(String packLabelCode,String deliveryOrderCode);

    List<ScanDeliveryVo> signSubmit(List<ScanDeliveryVo> list);

    List<ScanDeliveryVo> signSubmit2(List<ScanDeliveryVo> list);



    int  isSignProduct(String deliveryOrderCode,String skuCode);

    int getNum(String deliveryOrderCode);

    Integer countNotFinish(Long deliveryId);

    void inventoryInSubmit(List<OrderDeliveryLabel> list);

    /**
     * 签收提交
     * @param signList
     */
    void deliverySign(List<OrderDistributionLabelVO> signList);

}
